-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix localization rule \Localization\[CultureName]\[ModuleId].po #16419
Conversation
@hishamco could you please review both PRs? |
Sure, in my list |
Thank you! |
Looks good. Can you add a unit test? Not with a web app, really a unit test. |
test/OrchardCore.Tests/Localization/LocalizationManagerTests.cs
Outdated
Show resolved
Hide resolved
@hishamco Ready to review 😊 |
@@ -195,6 +195,7 @@ node_modules/ | |||
|
|||
wwwroot | |||
**/Localization/**/*.po | |||
!test/OrchardCore.Tests/Localization/**/*.po |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You must do this, or you will lose the PO files. You can try it.
test/OrchardCore.Tests/Localization/LocalizationManagerTests.cs
Outdated
Show resolved
Hide resolved
test/OrchardCore.Tests/Localization/LocalizationManagerTests.cs
Outdated
Show resolved
Hide resolved
[InlineData("zh-CN", "你好!")] | ||
public async Task TestLocalizationRule(string culture, string expected) | ||
{ | ||
var context = new SiteContext(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a functional test, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I don't understand what you mean. I think this is the closest test to the actual operation.
test/OrchardCore.Tests/Localization/LocalizationManagerTests.cs
Outdated
Show resolved
Hide resolved
test/OrchardCore.Tests/Localization/LocalizationManagerTests.cs
Outdated
Show resolved
Hide resolved
test/OrchardCore.Tests/Localization/LocalizationManagerTests.cs
Outdated
Show resolved
Hide resolved
<ItemGroup> | ||
<None Update="Localization\*\OrchardCore.Tests.po"> | ||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | ||
</None> | ||
</ItemGroup> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need, you can add them as embedded resources
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They are not same.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need to preserve the newest?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because the target rule needs to copy it to the output directory.
This pull request has merge conflicts. Please resolve those before requesting a review. |
Fixes #16153
unit test at :#16154